package com.blacktea.structuralpatterns.facadepattern.service;

import com.blacktea.structuralpatterns.facadepattern.dao.App01UserInfoRepository;
import com.blacktea.structuralpatterns.facadepattern.entity.App01Userinfo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @description:
 * @author: black tea
 * @date: 2023/3/22 22:41
 */
@Service
@RequiredArgsConstructor
public class App01UserInfoService {

    private final App01UserInfoRepository userInfoRepository;

    public Optional<App01Userinfo> getUserByName(String name){
        return Optional.ofNullable(userInfoRepository.findByName(name));
    }

}
